﻿@{
    ViewBag.Title = "Blogs by User ";
}
@using DirigoEdge.Utils
@model DirigoEdge.Models.ViewModels.BlogsByUserViewModel


<div class="row module blogByUserListing">
    
    @* Breadcrumbs *@
    <div class="breadcrumbsContainer">
        <div class="twelve columns">
            <ul class="breadcrumbs">
                <li>
                    <a href="/blog/">
                        <span>Blog Home</span>
                    </a>
                </li>
                @{
                    var author = !String.IsNullOrEmpty(Model.TheBlogUser.Username) ? Model.TheBlogUser.Username.Replace(" ", ContentGlobals.BLOGDELIMMETER) : "Anonymous";
                    var available = author == "Anonymous" ? "unavailable" : "current";
                }
                <li class="@available">
                    <a href="/blog/user/@author">
                        <span>@author.Replace(ContentGlobals.BLOGDELIMMETER, " ")</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="nine columns blogListing">
        
        <h2>Blogs by : @Model.BlogUsername</h2>

        @{
            if (Model.BlogsByUser.Count < 1)
            {
                <p>This user has no blog posts.</p>
            }
            else
            {

                // Renders the blog article tags
                @Html.Partial("/Views/Shared/Partials/BlogArticlePartial.cshtml", Model.BlogsByUser);
                
                <a id="LoadMoreBlogs" href="javascript:void(0);" value="Load More" class="secondary loadMore button" data-lastblog="@Model.BlogsByUser.LastOrDefault().BlogId" data-blogCount="@Model.MaxBlogCount">Load More</a>
            }
        }
    </div>

    <div class="three columns categoryBlogListModule">
        @* Blog Author *@
        @Html.Partial("~/Views/Shared/Partials/BlogAuthorPartial.cshtml", new DirigoEdge.Models.ViewModels.BlogAuthorViewModel(Model.BlogUsername))
        
        @* Categories *@
        @Html.Partial("~/Views/Shared/Partials/CategoriesListingPartial.cshtml", new DirigoEdge.Models.ViewModels.BlogsCategoriesViewModel(""))
        
        @* Latest Blogs / Popular *@
        @Html.Partial("~/Views/Shared/Partials/PopularBlogsPartial.cshtml", new DirigoEdge.Models.ViewModels.BlogPopularViewModel())
        
        @* Archive *@
        @Html.Partial("~/Views/Shared/Partials/BlogArchivePartial.cshtml", new DirigoEdge.Models.ViewModels.BlogArchiveViewModel())
    </div>

</div>